<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>hello div <b>!</b></div>
    <div class="d1">hello div <b>!</b></div>
    <div>hello div <b>!</b></div>
    <div class="d1">hello div <b>!</b></div>
    <script>
      const divEls = document.querySelectorAll("div");
      for (let el of divEls) {
        console.log(el);
      }

      console.log(Array.from(divEls));
      console.log([...divEls]);
    </script>
  </body>
</html>
